﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Skyworth.CRM.Service.Entity;
using Skyworth.CRM.Service.IBLL;
using Skyworth.CRM.Service.IDAL;

namespace Skyworth.CRM.BLL
{
   public class ProductTypeBLL:IProductTypeBLL
    {
       private IProductTypeDAL _productTypeDAL;

       public ProductTypeBLL(IProductTypeDAL productTypeDAL)
        {
            _productTypeDAL = productTypeDAL;
        }

       public DataTable GetAllProductTypeByBrand(int brandId)
       {
           return _productTypeDAL.GetAllProductTypeByBrand(brandId);
       }

       public DataTable GetAllSubProductType(int parentId)
       {
           return _productTypeDAL.GetAllSubProductType(parentId);
       }

       public void Add(ProductType model)
       {
          _productTypeDAL.Add(model);
       }

       public bool Update(ProductType model)
       {
          return _productTypeDAL.Update(model);
       }

       public bool Delete(int productTypeId)
       {
           return _productTypeDAL.Delete(productTypeId);
       }
    }
}
